# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1078 -> 1.1078.1.1 # arch/sparc/kernel/module.c 1.10 -> 1.11 # arch/alpha/kernel/module.c 1.4 -> 1.5 # arch/arm/kernel/module.c 1.6 -> 1.7 # arch/ppc/kernel/module.c 1.7 -> 1.8 # include/linux/moduleloader.h 1.5 -> 1.6 # arch/i386/kernel/module.c 1.10 -> 1.11 # arch/v850/kernel/module.c 1.4 -> 1.5 # arch/sparc64/kernel/module.c 1.12 -> 1.13 # kernel/module.c 1.80 -> 1.81 # arch/s390/kernel/module.c 1.7 -> 1.8 # arch/x86_64/kernel/module.c 1.7 -> 1.8 # arch/parisc/kernel/module.c 1.3 -> 1.4 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/05/13 davidm@tiger.hpl.hp.com 1.1079 # ia64: Move ia64 ELF relocations to ia64-specific elf.h. # -------------------------------------------- # 03/05/13 davidm@tiger.hpl.hp.com 1.1078.1.1 # Add module_arch_cleanup() callback. # -------------------------------------------- # diff -Nru a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c --- a/arch/alpha/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/alpha/kernel/module.c Thu May 15 13:40:57 2003 @@ -300,3 +300,8 @@ { return 0; } + +void +module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c --- a/arch/arm/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/arm/kernel/module.c Thu May 15 13:40:57 2003 @@ -159,3 +159,8 @@ { return 0; } + +void +module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/arch/i386/kernel/module.c b/arch/i386/kernel/module.c --- a/arch/i386/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/i386/kernel/module.c Thu May 15 13:40:57 2003 @@ -123,3 +123,7 @@ } return 0; } + +void module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c --- a/arch/parisc/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/parisc/kernel/module.c Thu May 15 13:40:57 2003 @@ -568,3 +568,7 @@ #endif return 0; } + +void module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/arch/ppc/kernel/module.c b/arch/ppc/kernel/module.c --- a/arch/ppc/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/ppc/kernel/module.c Thu May 15 13:40:57 2003 @@ -269,3 +269,7 @@ { return 0; } + +void module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c --- a/arch/s390/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/s390/kernel/module.c Thu May 15 13:40:57 2003 @@ -386,3 +386,7 @@ kfree(me->arch.syminfo); return 0; } + +void module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c --- a/arch/sparc/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/sparc/kernel/module.c Thu May 15 13:40:57 2003 @@ -145,3 +145,7 @@ { return 0; } + +void module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/arch/sparc64/kernel/module.c b/arch/sparc64/kernel/module.c --- a/arch/sparc64/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/sparc64/kernel/module.c Thu May 15 13:40:57 2003 @@ -273,3 +273,7 @@ { return 0; } + +void module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/arch/v850/kernel/module.c b/arch/v850/kernel/module.c --- a/arch/v850/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/v850/kernel/module.c Thu May 15 13:40:57 2003 @@ -230,3 +230,8 @@ return 0; } + +void +module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/arch/x86_64/kernel/module.c b/arch/x86_64/kernel/module.c --- a/arch/x86_64/kernel/module.c Thu May 15 13:40:57 2003 +++ b/arch/x86_64/kernel/module.c Thu May 15 13:40:57 2003 @@ -231,3 +231,7 @@ { return 0; } + +void module_arch_cleanup(struct module *mod) +{ +} diff -Nru a/include/linux/moduleloader.h b/include/linux/moduleloader.h --- a/include/linux/moduleloader.h Thu May 15 13:40:57 2003 +++ b/include/linux/moduleloader.h Thu May 15 13:40:57 2003 @@ -41,4 +41,7 @@ const Elf_Shdr *sechdrs, struct module *mod); +/* Any cleanup needed when module leaves. */ +void module_arch_cleanup(struct module *mod); + #endif diff -Nru a/kernel/module.c b/kernel/module.c --- a/kernel/module.c Thu May 15 13:40:57 2003 +++ b/kernel/module.c Thu May 15 13:40:57 2003 @@ -910,6 +910,9 @@ list_del(&mod->list); spin_unlock_irq(&modlist_lock); + /* Arch-specific cleanup. */ + module_arch_cleanup(mod); + /* Module unload stuff */ module_unload_free(mod); @@ -1276,6 +1279,7 @@ mod->module_init = ptr; /* Transfer each section which specifies SHF_ALLOC */ + DEBUGP("final section addresses:\n"); for (i = 0; i < hdr->e_shnum; i++) { void *dest; @@ -1293,6 +1297,7 @@ sechdrs[i].sh_size); /* Update sh_addr to point to copy in image. */ sechdrs[i].sh_addr = (unsigned long)dest; + DEBUGP("\t0x%lx %s\n", sechdrs[i].sh_addr, secstrings + sechdrs[i].sh_name); } /* Module has been moved. */ mod = (void *)sechdrs[modindex].sh_addr;